﻿using System;
using System.Runtime.InteropServices;

namespace MTBrainStorm.Models.VirtualKeyboard
{
    public class NativeMethods
    {
        [DllImport("USER32.DLL", CharSet = CharSet.Unicode)]
        public static extern int ToUnicodeEx(uint virtualKey, uint scanCode, byte[] keyStates, [MarshalAs(UnmanagedType.LPArray)] [Out] char[] chars, int charMaxCount, uint flags, IntPtr keyboardLayout);

        [DllImport("user32.dll")]
        public static extern uint GetKeyboardLayoutList(int nBuff, [Out] IntPtr[] lpList);

        [DllImport("user32.dll")]
        public static extern bool GetKeyboardState(byte[] lpKeyState);

        [DllImport("user32.dll")]
        public static extern IntPtr GetKeyboardLayout(uint idThread);

        [DllImport("user32.dll")]
        public static extern IntPtr LoadKeyboardLayout(string languageId, uint flags);
    }
}
